<?php
namespace Portal\Controller;
use Think\Controller;


Class PayMentController extends Controller{

  private $PayMode ;  //支付模式
  private $OrderID;   //业务工单号
  private $totalfee;   //金额
  private $Attach;    //任务描述


    //在类初始化方法中，引入相关类库
    public function _initialize()
   {
    $this->PayMode = I('PayMode');
    $this->OrderID = I('OrderID');
    $this->totalfee= I('Money');
    $this->Attach = I('Attach');
    $this->Body = I('Body');
    }
    public function index()
    {
    if(!$this->PayMode||!$this->OrderID)
     {
     	$data['status']=0;
     	$data['msg']='Transfer parameter error!';
     	$data = json_encode($data);
     	print_r($data);
     	exit(0);
     }



     switch($this->PayMode)
     {
     case '微信支付':


   $this->redirect('WxPay/WxQrcode',array('totalfee'=>$this->totalfee,'OrderID'=>$this->OrderID,'Attach'=>$this->Attach,'Body'=>$this->Body));



   // print_r('weixin');
      break;

     case '支付宝':
    print_r('alipay');
      break;

     case '余额支付':
    print_r('totalfee');
      break;
     default :
     print_r('not_pay!'.$PayMode);

     }






    }

   public function Paycomplete()
   {
   	$Orderid = I('orderid');
   	$totalfee = I('totalfee');
   	$resulturl = I('resulturl');
   	$this->assign('orderid',$Orderid);
   	$this->assign('totalfee',$totalfee);
   	if($resulturl)
   	{
   	 $this->success('支付已经完成',$resulturl,5);
   	}else
   	{
   	$this->success('支付已经完成',U('Mob/Task/My'));
   	}



   }












}






